<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<body>
    <ol class="page-navigator" th:fragment="pageNav(pageInfo, prevText, nextText, prefix)">
        <th:block th:if="${pageInfo.hasPreviousPage}">
            <li class="prev">
                <a th:href="@{'/'+${prefix}+'/'+${pageInfo.prePage}}" th:text="${prevText}"></a>
            </li>
        </th:block>


        <th:block th:each="navIndex :${ pageInfo.navigatepageNums}">
            <li th:class="${pageInfo.pageNum==navIndex}?'current':''">
                <a th:href="@{'?'+${prefix}+'='+ ${navIndex}}" th:text="${navIndex}"></a>
            </li>
        </th:block>


        <th:block th:if="${pageInfo.hasNextPage}">
            <li class="next">
                <a th:href="@{'/'+${prefix}+'/'+${pageInfo.nextPage}}" th:text="${nextText}"></a>
            </li>
        </th:block>

    </ol>

    <div th:fragment="pageAdminNav(pageInfo)">
        <div class="clearfix">
            <ul class="pagination m-b-5 pull-right">

                <th:block th:if="${pageInfo.pageNum != 1}">
                    <li>
                        <a th:href="@{'?page='+${pageInfo.firstPage}}">First</a>
                    </li>
                </th:block>

                <li th:if="${pageInfo.hasPreviousPage}">
                    <a th:href="@{'?page='+${pageInfo.prePage}}" aria-label="Previous">
                        <i class="fa fa-angle-left"></i>&nbsp;Prev
                    </a>
                </li>

                <th:block th:each="nav : ${pageInfo.navigatepageNums}">
                    <li th:class="${nav==pageInfo.pageNum}?'active disabled':''">
                        <a th:href="@{'?page='+${nav}}" th:text="${nav}"></a>
                    </li>
                </th:block>

                <th:block th:if="${pageInfo.hasNextPage}">
                    <li>
                        <a th:href="@{'?page='+${pageInfo.nextPage}}" aria-label="Next">
                            Next&nbsp;<i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </th:block>

                <th:block th:if="${pageInfo.pages != pageInfo.pageNum}">
                    <li>
                        <a th:href="@{'?page='+${pageInfo.lastPage}}">Last</a>
                    </li>
                </th:block>

                <li>
                    <span th:text="${pageInfo.pages}+' Pages Totally'"></span>
                </li>
            </ul>
        </div>
    </div>

</body>

</html>